package com.zmy.xcx.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmy.xcx.project.common.convention.exception.ClientException;
import com.zmy.xcx.project.common.enums.UserErrorCodeEnum;
import com.zmy.xcx.project.dao.entity.MildSymptom;
import com.zmy.xcx.project.dao.mapper.ClinicalSymptomMapper;
import com.zmy.xcx.project.service.MildSymptomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class MildSymptomImpl extends ServiceImpl<ClinicalSymptomMapper, MildSymptom> implements MildSymptomService {
    @Override
    public MildSymptom getMildSymptom(String id) {
        LambdaQueryWrapper<MildSymptom> queryWrapper= Wrappers.lambdaQuery(MildSymptom.class)
                .eq(MildSymptom::getId,id);
        MildSymptom mildSymptom=baseMapper.selectOne(queryWrapper);
        if (mildSymptom == null) {
            throw new ClientException(UserErrorCodeEnum.USER_NULL);
        }
        return mildSymptom;
    }
}
